<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>dojox.grid.DataGrid with trapping of data store errors.</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
	<style type="text/css">
		@import "../../../dijit/themes/tundra/tundra.css";
		@import "../../../dojo/resources/dojo.css";
		@import "../../../dijit/tests/css/dijitTests.css";
		@import "../resources/Grid.css";
		@import "../resources/tundraGrid.css";
		
		#grid{
			width: 65em;
			height: 25em;
			padding: 1px;
		}
	</style>
	<script type="text/javascript" src="../../../dojo/dojo.js" 
		djConfig="isDebug: true, debugAtAllCosts: false, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dijit.dijit");
		dojo.require("dojox.grid.DataGrid");
		dojo.require("dojox.data.CsvStore");
		dojo.require("dojo.parser");
	</script>

	<script type="text/javascript">
		var layoutMovies =[
			{ name: "Title", field: "Title", width: 'auto' },
			{ name: "Year", field: "Year", width: 5 },
			{ name: "Producer", field: "Producer", width: 20 }
		];
	</script>
</head>
<body class="tundra">
	<h1>dojox.grid.DataGrid with trapping of data store errors</h1>

	<h2>dojox.data.CsvStore:</h2>.
	<i>This grid does not load data.  The data store references a non-existent URL on purpose.  It should trigger a failure that we catch and display in an alert</i>
	<span dojoType="dojox.data.CsvStore" 
		jsId="csvStore" url="support/NoSuchMovieFile.csv">
	</span>
	<div id="grid" jsid="grid" dojoType="dojox.grid.DataGrid" elasticView="2" query="{ Title: '*' }"
		rowsPerPage="5" store="csvStore" structure="layoutMovies" autoRender="false">
		<script type="dojo/connect" event="onFetchError" args="error">
			alert("Error was encountered when store was queried: " + dojo.toJson(error, true));
		</script>
	</div>
</body>
</html>


